<?php
class pk_album extends BaseModel implements Retrievable {

	var $user;
	var $sports;
	var $updated;
	var $title;
	var $description;
	var $photo;
	var $type;
	var $keywords;
	
    public function pk_album($values) {
        parent::__construct($values);
    }

    public function validate() {
        $errors = Array();
		return (count($errors) === 0 ? true : $errors);
    }

    public static function get($id, $primaryKey='id') {
        return parent::get($id, __CLASS__, $primaryKey);
    }
    
    public static function getAll($searchArray=Array(), $sortArray=Array(), $limit=0) {
        return parent::getAll($searchArray, $sortArray, __CLASS__, $limit);
    }
    
    public static function getAlbumsOfSport($sport) {
    	return pk_album::getAll(array("sports"=>"[:custom] like '%|$sport|%'"), array("id", "DESC"),10);
    }
    
}
?>